<%-- 
    Document   : index
    Created on : Jun 4, 2013, 11:53:48 PM
    Author     : Nguyen Trung
--%>

<%@page import="com.google.gson.Gson"%>
<%@page import="dao.Question"%>
<%@page contentType="text/html" pageEncoding="UTF8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script type="text/javascript" src="./JavaScript/jquery-1.7.2.js" ></script>
        <script type="text/javascript">
            $.getJSON("/BookKeeper/resources/query",function(data){ });
            $.getJSON("/BookKeeper/ListBook",function(data){ });
            $.getJSON("/BookKeeper/ListChapter?idBook=Book1",function(data){ });
            $.getJSON("/BookKeeper/ListQuestion?idBook=Book2&idChap=chap3",function(data){ });
        </script>
        
    </head>
    <body>
        <h1>Hello World!</h1>
        <%
            Question[] questions = Question.readQuestion(getServletContext().getRealPath("/Book/Book1/chap1.txt"));
            Gson gson = new Gson();
            
            out.println(gson.toJson(questions));
        %>
    </body>
</html>
